home *** CD-ROM | disk | FTP | other *** search
/ PC Graphics Unleashed / PC Graphics Unleashed.iso / ch17 / pi / animlite / animlite.pi < prev   
Encoding:
Text File  |  1994-08-05  |  1.2 KB  |  58 lines

  1. // Scene File: ANIMLITE.PI
  2. // by Rob McGregor
  3. //
  4. // A moving light creates changing shadow effects
  5.  
  6. include "..\..\..\colors.inc"
  7. include "..\..\..\texture.inc"
  8. include "..\..\..\stones.inc"
  9.  
  10. // Define the range of the animation
  11. start_frame 0
  12. end_frame   49
  13. outfile     "light"
  14.  
  15. // Set up the camera
  16. viewpoint {
  17.   from       <0, 1.5, -4>
  18.   at         <0, 0.5, 0>
  19.   up         <0, 1, 0>
  20.   angle      45
  21.   resolution 320, 200
  22.   aspect     1.6
  23. }
  24.  
  25. background sky_blue
  26. haze 0.9, 25, sky_blue
  27.  
  28. // Define some tokens and a movement expression
  29. define startX  20
  30. define increment (frame - start_frame) / (end_frame - start_frame)
  31. define PosX (1 - increment) * startX + increment * -startX
  32.  
  33. // Move the light
  34. light <PosX, 10, 5>
  35.  
  36. // Create some objects to cast shadows
  37. object { sphere <1, 0.5, 0>, 0.5 reflective_blue }
  38.  
  39. object {
  40.   cone <0, -1, 0>, 0.5, <0, 0, 0>, 0
  41.   translate <-1, 1, 0>
  42.   Stone10
  43. }
  44.  
  45. object {
  46.   box <-1, -1, -1>, <1, 1, 1>
  47.   scale <0.25, 0.25, 0.25>
  48.   rotate <0, 45.0, 0>
  49.   translate <0, 0.25, 0.5>
  50.   reflective_gold
  51. }
  52.  
  53. // Something to cast the shadows on
  54. object {
  55.   disc <0, 0, 0>, <0, 1, 0>, 10000
  56.   Stone16 { scale <0.25, 1, 0.25> }
  57. }
  58.